package com.example.sesata.controller;

import com.example.sesata.domain.CommonResult;
import com.example.sesata.domain.Order;
import com.example.sesata.service.OrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chensixiang chensixiang1234@gmail.com
 */
@RestController
@RequiredArgsConstructor
public class OrderController {

    private final OrderService orderService;

    @GetMapping("/order/create")
    public CommonResult<Object> create(Order order) {
        // localhost:2001/order/create?userId=1&productId=1&count=10&money=100
        orderService.create(order);
        return new CommonResult<>(200, "订单创建成功");
    }

}
